<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    var test = function (a, b, c, d) {
        console.log(a + b + c + d);
    }(1, 2, 3, 4)

    function no_swap(a, b) {
        var tmp = a;
        a = b;
        b = tmp
    }

    var one = 1;
    var zero = 0;

    no_swap(one, zero)
    console.log(one, zero)

    function swap(a, b) {
        return [b, a]
    }
    [one, zero] = swap(one, zero)
    console.log(one,zero)
</script>